package is.origo.portlet.events;

import org.w3c.dom.DOMException;
import org.w3c.dom.Element;

import javax.portlet.*;
import javax.servlet.http.Cookie;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Map;

/**
 * @author vidar.svansson
 */
public class SimpleEventResponse
        implements EventResponse {

    private RenderResponse renderResponse;
    private ActionResponse actionResponse;    

    public SimpleEventResponse(RenderResponse response) {
        renderResponse = response;
        actionResponse = Events.actionResponse.get();
    }

    public void setRenderParameters(EventRequest eventrequest) {
    }

    public void addProperty(String s, String s1) {
        renderResponse.addProperty(s, s1);
    }

    public void setProperty(String s, String s1) {
        renderResponse.setProperty(s, s1);
    }

    public String encodeURL(String s) {
        return renderResponse.encodeURL(s);
    }

    public String getNamespace() {
        return renderResponse.getNamespace();
    }

    public void addProperty(Cookie cookie) {
        renderResponse.addProperty(cookie);
    }

    public void addProperty(String s, Element element) {
        renderResponse.addProperty(s, element);
    }

    public Element createElement(String s)
            throws DOMException {
        return renderResponse.createElement(s);
    }

    public void setWindowState(WindowState windowState)
            throws WindowStateException {
        actionResponse.setWindowState(windowState);
    }

    public void setPortletMode(PortletMode portletMode)
            throws PortletModeException {
        actionResponse.setPortletMode(portletMode);
    }

    public void setRenderParameters(Map stringMap) {
        actionResponse.setRenderParameters(stringMap);
    }

    public void setRenderParameter(String s, String s1) {
        actionResponse.setRenderParameter(s, s1);
    }

    public void setRenderParameter(String s, String strings[]) {
        actionResponse.setRenderParameter(s, strings);
    }

    public void setEvent(QName qName, Serializable serializable) {
        actionResponse.setEvent(qName, serializable);
    }

    public void setEvent(String s, Serializable serializable) {
        actionResponse.setEvent(s, serializable);
    }

    public Map getRenderParameterMap() {
        return actionResponse.getRenderParameterMap();
    }

    public PortletMode getPortletMode() {
        return actionResponse.getPortletMode();
    }

    public WindowState getWindowState() {
        return actionResponse.getWindowState();
    }

    public void removePublicRenderParameter(String s) {
        actionResponse.removePublicRenderParameter(s);
    }
}